Page({
  data: {
    list: [],
    imgList: []
  },

  onLoad() {
    const that = this
    const db=wx.cloud.database({
      env:'white-8g5pbu0id0b9a16c'
    }) 
    db.collection('information').get({
      success:res =>{
       that.setData({
        list: res.data
       })
      }
    })
  },

  // 拨打电话
  freeTell(e) {
    wx.makePhoneCall({
      phoneNumber: e.currentTarget.dataset.iphone
    })
  },
  //预览图片
  //预览图片
  previewImage(e) {
    let currentUrl = e.currentTarget.dataset.src
    this.data.imgList[0] = currentUrl
    wx.previewImage({
      current: currentUrl, // 当前显示图片的http链接
      urls: this.data.imgList // 需要预览的图片http链接列表
    })
  },
})